package com.tuyrt.firstcode.kotlin.generics

/**
 * Created by tuyrt7 on 2021/4/12.
 * 泛型
 */


//通过 reified 关键字，可以实例化内联函数的泛型
inline fun <reified T> getGeneric() = T::class.java
fun main() {

    val intType = getGeneric<Int>()
    val strType = getGeneric<String>()

    println("intType: $intType")
    println("strType: $strType")
}